package com.simple.system.service;
import com.simple.system.entity.SysRoles;
import com.simple.system.entity.SysUser;
import com.simple.system.repository.SysRolesRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.concurrent.TimeUnit;


@Service
public class SysRolesService {
    @Autowired
    private SysRolesRepository rolesRepository;

    public List<SysRoles> getAllRoles() {
        return rolesRepository.findAll();
    }

    public SysRoles saveRole(SysRoles role) {
        return rolesRepository.save(role);
    }

    public void deleteRole(Long id) {
        rolesRepository.deleteById(id);
    }


}
